<template>
  <div>
      书名:<input type="text" v-model="name"><br>
      销量:<input type="text" v-model="sale"><br>
      价格:<input type="text" v-model="price"><br>
      <select v-model="author_id">
          <option value="1">普通作者</option>
          <option value="2">VIP作者</option>
      </select><br>
      <button @click="add">添加</button>
  </div>
</template>

<script>
export default {
    name:'book_post',
    data(){
        return{
            name:'',
            sale:'',
            price:'',
            author_id:''
        }
    },
    methods:{
        add(){
            let data = new FormData();
            data.append('name',this.name)
            data.append('sale',this.sale)
            data.append('price',this.price)
            data.append('author_id',this.author_id)
            this.axios.post('yt4/',data).then(res=>{
                this.$router.push('book_get')
            })
        }
    }
}
</script>

<style>

</style>